<?php

session_start();
$error='';

function redirect($page) {
    header('Location: ' . $page);
    exit;
}


if (isset($_POST['password'])) {
    

    $password = htmlentities((trim($_POST['password'])));

    if (md5($password) === '518c46302aa97d2d7be44a6b05d5b9d7') {
        $_SESSION['id_siswa'] = 'id_siswa_demo';
        $_SESSION['username']='username_demo';
        $_SESSION['tingkat'] = 'tingkat_demo';
        $_SESSION['nim'] = 'nim_demo';
        redirect("vote.php");}
    else $error='Password Salah';
    } else{
        unset($_POST['password']);
    }
        
?>
